#!/usr/bin/python
from docxtpl import DocxTemplate
import pypandoc

output_path = "D:\\11.docx"

def test():
    pypandoc.convert_file("D:\\1.html", 'docx', outputfile=output_path)
    # html_doc = DocxTemplate(output_path)
    new_doc = DocxTemplate("D:\\test_template.docx")

    new = new_doc.new_subdoc(docpath=output_path)
    print(new)
    new_doc.render({
        'template':new,
    })
    new_doc.save("D:\\test1.docx")

if __name__ == "__main__":
    test()
